function myCls() {
    this.name = "测试"
}

myCls.prototype.say = function () {
    return this.name
}

let my = new myCls()
console.log(my.say())//测试

class myCls2  extends myCls{
    //静态方法
    static create(no,name) {
        super(name)
        return new myCls2(no,name)
    }
    constructor(no,name) {
        this._no = no
    }
    //实例方法
    say() {
        return this._no
    }
}

// let my2 = new myCls2('测试2')
// console.log(my2.say())//测试2
let my2=myCls2.create(1,'测试2')
console.log(my2.say())